package com.shop.beans;

import java.util.Date;
import java.util.Objects;

public class User {
    int id;
    String username;
    String password;
    String realname;
    String cardid;
    Date birthday;
    String phone;
    String userInfo;

    public User() {
    }

    public User(String username, String password, String realname, String cardid, Date birthday, String phone, String userInfo) {
        this.username = username;
        this.password = password;
        this.realname = realname;
        this.cardid = cardid;
        this.birthday = birthday;
        this.phone = phone;
        this.userInfo = userInfo;
    }

    public User(int id, String username, String password, String realname, String cardid, Date birthday, String phone, String userInfo) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.realname = realname;
        this.cardid = cardid;
        this.birthday = birthday;
        this.phone = phone;
        this.userInfo = userInfo;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", realname='" + realname + '\'' +
                ", cardid='" + cardid + '\'' +
                ", birthday=" + birthday +
                ", phone='" + phone + '\'' +
                ", userInfo='" + userInfo + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id && Objects.equals(username, user.username) && Objects.equals(password, user.password) && Objects.equals(realname, user.realname) && Objects.equals(cardid, user.cardid) && Objects.equals(birthday, user.birthday) && Objects.equals(phone, user.phone) && Objects.equals(userInfo, user.userInfo);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, password, realname, cardid, birthday, phone, userInfo);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getCardid() {
        return cardid;
    }

    public void setCardid(String cardid) {
        this.cardid = cardid;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getUserInfo() {
        return userInfo;
    }

    public void setUserInfo(String userInfo) {
        this.userInfo = userInfo;
    }
}
